<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Main extends CI_Controller {
    
    var $data = array();
   
        function Main(){
            parent::__construct();
            $this->load->helper('asset');
            $this->load->helper('cookie');
            $this->load->helper('auth');
            $this->load->library('session');
            $this->load->helper('url');
            $this->data = array(
                'header' => $this->load->view('header', '', TRUE),
                'footer' => $this->load->view('footer', '', TRUE),
                'menu_nav' => $this->load->view('menu_nav', '', TRUE)
            );
        }
	public function index(){
            if( $this->session->userdata('username') != FALSE ){
                $data = array();
                $data['login'] = $this->session->userdata('username');
                $this->data['gadget'][] = $this->load->view('login_form', $data, TRUE);
            }
            else{
                $this->data['gadget'][] = $this->load->view('auth_form', '', TRUE);
            }
            $this->load->view('index', $this->data);
	}
        public function new_bug(){
            $this->load->model('databasebug', '', TRUE);
            $query['product_version'] = $this->databasebug->get_product_version()->result_array();
            $this->load->view('new_bug', $query);
        }
        public function signin(){
            $login = $this->input->post('login');
            $password = $this->input->post('password');
        }
}